﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/PBOAMasterPage.master"
    AutoEventWireup="true" CodeFile="AddMeeting.aspx.cs" Inherits="MeetingManager_AddMeeting" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../CSS/Meeting.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
   <style type="text/css">
        #preview_div
        {
            /* 该对象用于在IE下显示预览图片 */
            filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);
        }
    </style>
    <script type="text/javascript">
        function checkImage(FileUpload) {
            var mime = FileUpload.value;
            mime = mime.toLowerCase().substr(mime.lastIndexOf("."));
            if (mime != ".jpg") {
                FileUpload.value = "";
                alert("仅支持JPG格式");
                return false;
            }
            else {
                var ua = navigator.userAgent.toLowerCase();
                var preview_div = document.getElementById("preview_div");
                var preview_img = document.getElementById("<%=imgBookCover.ClientID%>")//母板页页服务器控件的获取方式

                var ver = ua.substr(ua.indexOf("msie") + 5, 1);
                if (ver > 6) {
                    preview_div.style.display = "";
                    preview_div.filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = FileUpload.value;
                    preview_img.style.display = 'none';
                }
                else {
                    preview_img.src = fup.value;
                }
            }
        }

    </script>
    <div id="add">
        <table id="meetingset">
             <tr >
                <asp:Panel ID="plNo" runat="server">
               
                <th>
                    会议室编号：
                </th>
                <td>
                    <asp:Label ID="lblNo" runat="server" Text="Label"></asp:Label>
                </td>
               
                </asp:Panel></tr>
                
          
            <tr>
                <th>
                    会议室名称：
                </th>
                <td>
                    <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvMeetingRoom" runat="server" 
                        ErrorMessage="* 请输入名称" ControlToValidate="txtName" ForeColor="Red"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>
                    会议室类型：
                </th>
                <td>
                    <asp:DropDownList ID="ddlType" runat="server" Width="150px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <th>
                    使用面积：
                </th>
                <td>
                    <asp:TextBox ID="txtArea" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvAera" runat="server" 
                        ControlToValidate="txtArea" ErrorMessage="* 请输入面积" ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revAera" runat="server" 
                        ErrorMessage="请输入合法的整数或小数" ControlToValidate="txtArea" ForeColor="Red" 
                        ValidationExpression="^[1-9]\d*\.\d*|0\.\d*[1-9]\d*$|[1-9]\d*$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <th>
                    容纳人数：
                </th>
                <td>
                    <asp:TextBox ID="txtNum" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvNum" runat="server" 
                        ControlToValidate="txtNum" ErrorMessage="*请输入人数" ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="revNum" runat="server" 
                        ControlToValidate="txtNum" ErrorMessage="请输入合法正整数" ForeColor="Red" 
                        ValidationExpression="^[1-9]\d*$"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr>
                <th>
                    办公设备：
                </th>
                <td>
                    <asp:TextBox ID="txtEqu" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfvEpm" runat="server" 
                        ControlToValidate="txtEqu" ErrorMessage="* 请输入办公设备" ForeColor="Red"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>
                    会议室图片:
                </th>
                <td>
                    <asp:FileUpload ID="fvImage" runat="server" onchange="checkImage(this)" />
                </td>
            </tr>
        </table>
        <div id="preview_div">
            <asp:Image ID="imgBookCover" runat="server" Height="120px" Width="100px" CssClass="preview " />
        </div>
        <div id="submit">
            <asp:Button ID="btnOk" runat="server" Text="提交" OnClick="Button1_Click" Height="25px"
                Width="70px" /></div>
    </div>
</asp:Content>
